/*
*	Copyright (C) 2014  Julio Montes, Mario Carrillo
*	
*	Julio Montes e-mail: imc.coder@gmail.com 
*
*	Mario Carrillo e-mail: mario_90ago@live.com.mx
*
*	BSD 3-Clause License
*/

#include "include/iaAboutDialog.h"
#include "sdk/include/path.h"

#include <wx/notebook.h>

BEGIN_EVENT_TABLE( iaAboutDialog, wxDialog )
    EVT_BUTTON( wxID_CLOSE, iaAboutDialog::OnClose )
END_EVENT_TABLE()

iaAboutDialog::iaAboutDialog( wxWindow *parent )
    : wxDialog( parent, wxID_ANY, wxT( "About of IDEALL" ), wxDefaultPosition, wxSize( 420, 440 ) )
{
    wxBoxSizer *bsMain = new wxBoxSizer( wxVERTICAL );

    bsMain->AddSpacer( 20 );
    wxImage image( sdk::Path::s_dirImages + wxT( "IDEALL.png" ), wxBITMAP_TYPE_PNG );
    wxBitmap bm( image.Scale( 380, 90 ) );
    //bm.SetWidth( 200 );
    //bm.SetHeight();
    wxStaticBitmap *sbIDEALL = new wxStaticBitmap( this, wxID_ANY, bm );
    bsMain->Add( sbIDEALL, 0, wxEXPAND | wxLEFT | wxRIGHT, 15 );





    bsMain->AddSpacer( 10 );
    wxNotebook *notebook = new wxNotebook( this, wxID_ANY );

    wxTextAttr attr( wxT( "#000000" ), wxNullColour, wxFont( 10, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT( "Monospace" ) ) );


    const wxString description( wxT( "IDEALL is an integrated development environment " )
    wxT( "that is capable of supporting plugins, the plugin most prominent is " )
    wxT( "VLSI design with Alliance which is responsible for creating and compiling projects also of run the viewers of Alliance" ) );

    wxTextCtrl *tcDescription = new wxTextCtrl( notebook, wxID_ANY, description, wxDefaultPosition, wxDefaultSize, wxTE_READONLY | wxTE_MULTILINE );
    tcDescription->SetStyle( 0, description.Len(), attr );
    notebook->AddPage( tcDescription, wxT( "Description" ) );



    const wxString authors( wxT( "Montes Carrasco Julio Israel\ne-mail: imc.coder@gmail.com\n\n" )
        wxT( "Carrillo Arévalo Mario Alfredo\ne-mail: mario_90ago@live.com.mx\n" ) );
    wxTextCtrl *tcAuthors = new wxTextCtrl( notebook, wxID_ANY, authors, wxDefaultPosition, wxDefaultSize, wxTE_READONLY | wxTE_MULTILINE );
    tcAuthors->SetStyle( 0, authors.Len(), attr );
    notebook->AddPage( tcAuthors, wxT( "Authors" ) );


    const wxString specialThanks( wxT( "Special thanks to our families for helping us\nat all times and in all aspects\n\n\n\n" )
        wxT( "---\n" )
        wxT( "The open-source community\n" )
        wxT( "The wxWidgets project (http://www.wxwidgets.org).\n" )
        wxT( "wxScintilla (http://sourceforge.net/projects/wxscintilla).\n" )
        wxT( "TinyXML parser (http://www.grinninglizard.com/tinyxml).\n" )
        wxT( "Code::Blocks project(http://www.codeblocks.org.\n" ) );
    wxTextCtrl *tcSpecialThanks = new wxTextCtrl( notebook, wxID_ANY, specialThanks, wxDefaultPosition, wxDefaultSize, wxTE_READONLY | wxTE_MULTILINE | wxTE_DONTWRAP );
    tcSpecialThanks->SetStyle( 0, specialThanks.Len(), attr );
    notebook->AddPage( tcSpecialThanks, wxT( "Special thanks" ) );



//    const wxString license( wxT( "" ) );
//    wxTextCtrl *tcLicense = new wxTextCtrl( notebook, wxID_ANY, license, wxDefaultPosition, wxDefaultSize, wxTE_READONLY | wxTE_MULTILINE );
//    notebook->AddPage( tcLicense, wxT( "License" ) );


    bsMain->Add( notebook, 1, wxEXPAND | wxLEFT | wxRIGHT, 15 );







    bsMain->AddSpacer( 10 );
    wxButton *btnClose = new wxButton( this, wxID_CLOSE );
    bsMain->Add( btnClose, 0, wxALIGN_RIGHT | wxRIGHT, 15 );
    bsMain->AddSpacer( 10 );





    SetSizer( bsMain );
}

iaAboutDialog::~iaAboutDialog()
{

}

void iaAboutDialog::OnClose( wxCommandEvent &evt )
{
    EndModal( wxID_CLOSE );
}
